<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles"
	prefix="tiles"%>

<rich:panel header="#{messages['rci.outgoing.member.maintenance']}">
	
	<h:panelGrid width="100%" columns="1">
		<h:panelGroup>
			<h:panelGrid>
				<h:outputText value="#{errorBean.errorMessage}" styleClass="error"></h:outputText>
			</h:panelGrid>
		</h:panelGroup>
		
		<h:panelGroup>
			<h:panelGrid width="100%">
				<h:panelGroup>
				    <h:outputText value="#{messages['rci.member.label']}" styleClass="sub_header" />
					<h:outputText value="*" styleClass="standardText_Mandatory" />
					<h:outputText value="#{messages['instruction']}" styleClass="standardText_Instruction" />
				</h:panelGroup>
			</h:panelGrid>
		</h:panelGroup>

		<%-- 
		<h:panelGroup>
			<t:panelGrid columns="2" columnClasses="standardTable_ColumnLeft_20,standardTable_ColumnLeft_80" width="100%">
				<h:panelGroup></h:panelGroup>
				
				<h:panelGroup>
					<h:selectBooleanCheckbox value="#{adminRCIBean.externalMember}" >
						<a4j:support ajaxSingle="true" event="onclick" reRender="hgvcMember" actionListener="#{adminRCIBean.externalFlagActionEvent}" ></a4j:support>
					</h:selectBooleanCheckbox>
					<h:outputText value="#{messages['is.external.label']}" styleClass="standardText_Label" />
				</h:panelGroup>
			</t:panelGrid>	
		</h:panelGroup>
		--%>

		<h:panelGroup id="hgvcMember"  >
			<t:panelGrid columns="2" columnClasses="standardTable_ColumnLeft_20,standardTable_ColumnLeft_80" width="100%">
				<h:outputText ></h:outputText>
				<t:message  for="member" styleClass="error"></t:message>
				<h:panelGroup >
					<h:outputText value="*" styleClass="standardText_Mandatory" />
					<h:outputLabel for="member" value="#{messages['member.name.label']}" styleClass="standardText_Label" />
				</h:panelGroup>
				<h:panelGroup >
					<t:selectOneMenu id="member" styleClass="standardText" value="#{adminRCIBean.member.memberId}" required="false">
						<f:selectItem itemLabel="#{messages['please.select']}" itemValue="" />
						<f:selectItems value="#{adminRCIBean.selectMemberList}"/>
						<a4j:support ajaxSingle="true" event="onclick" reRender="agreement"></a4j:support>
					</t:selectOneMenu>
				</h:panelGroup>
				
				<h:outputText ></h:outputText>
				<t:message  for="agreement" styleClass="error"></t:message>
				<h:panelGroup >
					<h:outputText value="*" styleClass="standardText_Mandatory" />
					<h:outputLabel for="agreement" value="#{messages['agreement.no']}" styleClass="standardText_Label" />
				</h:panelGroup>
				<h:panelGroup >
					<t:selectOneMenu id="agreement" styleClass="standardText" value="#{adminRCIBean.agreement.agreementId}" required="false">
						<f:selectItem itemLabel="#{messages['please.select']}" itemValue="" />
						<f:selectItems value="#{adminRCIBean.selectAgreementList}"/>
						<a4j:support ajaxSingle="true" event="onclick" reRender="membershipCategory"></a4j:support>
					</t:selectOneMenu>
				</h:panelGroup>
		
				<h:outputLabel  for="membershipCategory" value="#{messages['membership.category']}" styleClass="standardText_Label" />
				<h:outputText  id="membershipCategory" styleClass="standardText" value="#{adminRCIBean.agreement.membership.membershipCategory.name}"></h:outputText>
				<%-- 
				<h:outputLabel rendered="#{!adminRCIBean.externalMember}" for="fullMembershipPrice" value="#{messages['full.membership.price']}" styleClass="standardText_Label" />
				<h:outputText rendered="#{!adminRCIBean.externalMember}" id="fullMembershipPrice" styleClass="standardText" value="#{adminRCIBean.agreement.fullMembershipPrice}"></h:outputText>
				
				<h:outputLabel rendered="#{!adminRCIBean.externalMember}" for="membershipPricePaidToDate" value="#{messages['rci.member.membership.paid.to.date.label']}" styleClass="standardText_Label" />
				<h:outputText rendered="#{!adminRCIBean.externalMember}" id="membershipPricePaidToDate" styleClass="standardText" value=""></h:outputText>
				
				<h:outputLabel rendered="#{!adminRCIBean.externalMember}" for="membershiPercentagePaidToDate" value="#{messages['rci.member.percentage.paid.to.date.label']}" styleClass="standardText_Label" />
				<h:outputText rendered="#{!adminRCIBean.externalMember}" id="membershiPercentagePaidToDate" styleClass="standardText" value=""></h:outputText>
				--%>
<%-- 
				<h:outputText  ></h:outputText>
				<t:message  for="rciMemberName" styleClass="error"></t:message>
				<h:panelGroup >
					<h:outputText value="*" styleClass="standardText_Mandatory" />
					<h:outputLabel for="rciMemberName" value="#{messages['rci.member.name.label']}" styleClass="standardText_Label" />
				</h:panelGroup>
				<t:inputText  id="rciMemberName" size="50" maxlength="50" styleClass="standardText" value="#{adminRCIBean.rciMember.rciMemberName}"></t:inputText>
				
				
				<h:outputText  ></h:outputText>
				<t:message  for="rciMemberIC" styleClass="error"></t:message>
				<h:panelGroup >
					<h:outputText value="*" styleClass="standardText_Mandatory" />
					<h:outputLabel for="rciMemberIC" value="#{messages['rci.member.ic.label']}" styleClass="standardText_Label" />
				</h:panelGroup>
				<t:inputText  id="rciMemberIC" size="20" maxlength="20" styleClass="standardText" value="#{adminRCIBean.rciMember.rciMemberIcNo}"></t:inputText>
				--%>
			</t:panelGrid>
		</h:panelGroup>
	</h:panelGrid>
	
	
	<t:panelGrid columns="2" columnClasses="standardTable_ColumnLeft_20,standardTable_ColumnLeft_80" width="100%">
		
		
		<h:outputText></h:outputText>
		<t:message for="rciNo" styleClass="error"></t:message>
		<h:panelGroup>
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<h:outputLabel for="rciNo" value="#{messages['rci.member.rci.no.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<t:inputText id="rciNo" size="20" maxlength="20" styleClass="standardText" value="#{adminRCIBean.rciMember.rciNo}"></t:inputText>
		
		<h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="enrollmentDate" value="#{messages['rci.enrollment.date.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<h:panelGroup>
		    	<t:inputCalendar
		    	id="enrollmentDate"
					monthYearRowClass="yearMonthHeader" weekRowClass="weekHeader" 
					currentDayCellClass="currentDayCell" value="#{adminRCIBean.rciMember.enrollmentDate}"
					renderAsPopup="true" popupTodayString="#{messages['popup.today']}"
					popupWeekString="#{messages['popup.week']}" popupDateFormat="dd/MM/yyyy"
					renderPopupButtonAsImage="true"
					styleClass="standardText" 
		    	>
		    	</t:inputCalendar>
		</h:panelGroup>
		
		<h:outputText></h:outputText>
		<t:message for="enrolmentAmount" styleClass="error"></t:message>
		<h:panelGroup>
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<h:outputLabel for="enrolmentAmount" value="#{messages['rci.enrollment.amt.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<t:inputText id="enrolmentAmount" size="20" maxlength="20" styleClass="standardText" value="#{adminRCIBean.rciMember.enrollmentAmount}"></t:inputText>
		
		<h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="effectiveDate" value="#{messages['effective.date.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<h:panelGroup>
		    	<t:inputCalendar
		    	id="effectiveDate"
					monthYearRowClass="yearMonthHeader" weekRowClass="weekHeader" 
					currentDayCellClass="currentDayCell" value="#{adminRCIBean.rciMember.effectiveDate}"
					renderAsPopup="true" popupTodayString="#{messages['popup.today']}"
					popupWeekString="#{messages['popup.week']}" popupDateFormat="dd/MM/yyyy"
					renderPopupButtonAsImage="true"
					styleClass="standardText" 
		    	>
		    	</t:inputCalendar>
		</h:panelGroup>
		
		<h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="expiryDate" value="#{messages['expiry.date.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<h:panelGroup>
		    	<t:inputCalendar
		    	id="expiryDate"
					monthYearRowClass="yearMonthHeader" weekRowClass="weekHeader" 
					currentDayCellClass="currentDayCell" value="#{adminRCIBean.rciMember.expiryDate}"
					renderAsPopup="true" popupTodayString="#{messages['popup.today']}"
					popupWeekString="#{messages['popup.week']}" popupDateFormat="dd/MM/yyyy"
					renderPopupButtonAsImage="true"
					styleClass="standardText" 
		    	>
		    	</t:inputCalendar>
		</h:panelGroup>
		
		<rich:spacer height="10"></rich:spacer>
		
		<t:panelGroup>
		   <t:panelGrid columns="2">
		   		<h:commandButton value="#{messages['create']}" styleClass="button" action="#{adminRCIBean.addRCIMemberAction}" actionListener="#{adminRCIBean.addRCIMemberActionEvent}"></h:commandButton>
			    <h:commandButton value="#{messages['back']}" styleClass="button" action="#{adminRCIBean.initRCIMemberAction}" immediate="true"></h:commandButton>
		   </t:panelGrid>
		</t:panelGroup>
	</t:panelGrid>
</rich:panel>	